<template>
    <div>
        <Navtitle :titles="title"></Navtitle>
        <div v-for="item in goodsApiData">
            <router-link :to="/detail/ + item.goods_id">
                <van-card :num="item.goods_number" :price="item.goods_price" :title="item.goods_name"
                    :thumb="item.goods_big_logo ? item.goods_big_logo : 'https://fastly.jsdelivr.net/npm/@vant/assets/ipad.jpeg'" />
            </router-link>
        </div>
    </div>
</template>

<script setup>
import Navtitle from '@/components/Navtitle.vue';
const title = '商品列表'
import { goodsApi } from '@/api/api';
import { ref } from 'vue';
import { useRoute } from 'vue-router';
let goodsApiData = ref([])
let route = useRoute()
goodsApi(route.params.query).then(res => {
    console.log(res);
    goodsApiData.value = res.data.message.goods

})
</script>

<style lang="scss" scoped></style>